﻿<%@ Page Title="" Language="C#" MasterPageFile="~/companypart/CompanyMastermaster.master" AutoEventWireup="true" CodeFile="SendmsgAdmin.aspx.cs" Inherits="companypart_SendmsgAdmin" meta:resourcekey="PageResource1"%>
<%@ Register Src="~/Sendmail.ascx" TagName="Sendmail" TagPrefix="SM" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../jqModal.css" rel="stylesheet" type="text/css" />
    <title>البريد الوارد</title>
    <style type="text/css">
    tr .tabbone4{ 
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:right;
	
}
.adel4{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  right;
}
         .zr3 {
	background-image:url('../images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('../images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
.txt3
{
    border:1px solid black;
    }
        HideButton { Display : none;} 
         .collapse
    {
    	background-color: #C0C0C0;
    	display:block;
    	
    }
 .newzr3{
	background:  url('../images/Untitled-2_03.png') right ;
	height:20px;
	 background-repeat:no-repeat;
	 float:left;
	 margin-top:5px;
	 text-align: center;
	 padding-right:15px;
	 cursor:pointer;
	 font-family:Tahoma;
	 font-size:14px;
	 color:#003353;
	 text-decoration:none;
	 
}
.newzr3:hover{
	color: #00b4ff;
	background-image:url('../images/Untitled-2ho_03.png');
	background-repeat:no-repeat;

} 
        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 10%;
    left: 42%;
    
    margin-left: -300px;
    width: 800px;
    
    background-color: #fff;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}

.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
        
    </style>
 <script src="../jqModal.js" type="text/javascript"></script>
    <script type="text/javascript">

    function there() {

        $("#dialog").jqm({ modal: true }).jqmShow();


    }

function htmlEncode(value){
  return $('<div/>').text(value).html();
}

function htmlDecode(value){
  return $('<div/>').html(value).text();
}


    function quickread(RowIndex) {



        var x = document.getElementById(RowIndex); //

        var y = document.getElementById('Text1');

        y.innerHTML = htmlDecode(x.value);

    }

    function GetCellValue(RowIndex) {


        window.open("mailindetails.aspx?index=" + RowIndex, '_blank');


    }
    
      </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
                 <br />                   
    <asp:UpdatePanel ID="up1" runat="server" ChildrenAsTriggers="true" RenderMode="Inline">
    <ContentTemplate>
    
   
    <table    dir="ltr">
     <tr dir="rtl">
    <td >
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        
            DeleteCommand="delete System_messages where id = @id"
            SelectCommand="select * from system_messages where  company_id in(0,@myid) order by id desc" 
            UpdateCommand="update  system_messages set checked=1  where checked=0 and company_id =@myid">
     <SelectParameters>
         <asp:SessionParameter Name="myid" SessionField="company_id" />
     </SelectParameters>
     <UpdateParameters>
         <asp:Parameter Name="myid" />
     </UpdateParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" 
        DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" DataKeyNames="id" 
       OnRowCreated="GridView1_RowCreated" onrowdatabound="GridView1_RowDataBound" 
            EnableModelValidation="True" GridLines="None" 
           >
        <Columns>
         <asp:TemplateField>
                            <HeaderTemplate>
                                <div >
                                    <table class="tab3">
                                    <tr>
                                    <td colspan="3" style=" padding-left :10px;">
                            <asp:LinkButton  runat="server" CssClass="newzr3" ID="edits" Text='ارسال ميل' meta:resourceKey="lblshow"  PostBackUrl="~/companypart/Sends.aspx" />
                           
                           
                                    </td>
                                    </tr>
                                        <tr class="tabbone3">
                                            <td style="width:200px">
                                                <asp:Label ID="lblendofsubs" runat="server" Text="الكتاب/الدورية" meta:resourceKey="dates"
                                                     />
                                            </td>
                                            <td style="width:200px">
                                                <asp:Label ID="lblstops" runat="server" Text="الوصف" meta:resourceKey="message" Width="60px" />
                                            </td>
                                            <td style="width:200px">
                                                <asp:Label ID="lblstartofsubs" runat="server" Text="المؤلف" meta:resourceKey="title"
                                                     />
                                            </td>
                                           <td style="width:20px">
                                                <asp:Label ID="Label1" runat="server" 
                                                     />
                                            </td>
                                            </tr>
                                    </table>
                                </div>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table class="tab3">
                                    <tr class="adel3">
                                        <td style="width:200px">
                                            <asp:Label ID="Label11" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("dates"))) %>'
                                                />
                                        </td>
                                        <td style="width:200px">
                                           

                                              <asp:Label   ID="txt" runat="server" Text='<%# (Eval("message").ToString().Length>=30) ? Eval("message").ToString().Substring(0,30)+"..." :Eval("message").ToString() %>'
                                             />
                                            
                                            <input id="msg" runat="server" type="hidden" value='<%#  HttpUtility.HtmlEncode(Eval("message").ToString()) %>' />
                                        </td>
                                        <td style="width:200px">
                                            <asp:Label  ID="startofsub" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("title"))) %>'
                                                 />
                                        </td>
                                        <td style="width:20px">
                                               <asp:LinkButton runat="server" ID = "DeleteButton" Text="X" CommandName="Delete" />
                                            </td>
                                             <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                                                    ConfirmText="<%$ Resources:Resource, delconfirm %>" TargetControlID="DeleteButton" />
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
              
        </Columns>
       
    </asp:GridView>
    <br />
</td>
</tr>
<tr>
<td dir="rtl" >

 </td>
</tr>
 <tr>
 
      <td>
   <div dir="rtl">
    <div class="tab3" id="Text1"   dir="rtl" style="height:700px"></div>
    </div>
       </td>
   </tr>
</table>
 </ContentTemplate>
    </asp:UpdatePanel>
<div class="jqmWindow" id="dialog">

<a href="#" class="jqmClose" style="background-image:url('../images/close.png');
	 width:39px;
	 height:40px;
	  background-repeat:no-repeat;
	  display:block;
	  float:left;	"></a>
 <sm:sendmail ID="Sendmail1" runat="server" />
</div>
</asp:Content>

